Skip to content

feat(sidebar): drag-resize content width with a mouse handle - #49

Merged
denolfe merged 2 commits into
mainfrom
feat/sidebar-drag-resize
Aug 13, 2026
Merged

feat(sidebar): drag-resize content width with a mouse handle#49
denolfe merged 2 commits into
mainfrom
feat/sidebar-drag-resize

Conversation

@denolfe

@denolfe denolfe commented Aug 13, 2026

Copy link
Copy Markdown
Owner

Makes scrollbar draggable. Content flows to width of content view. Double-clicking resets the resize.

CleanShot.2026-08-13.at.19.47.01.mp4

Key Changes

  • Content-width resize
    • An invisible 1-col grab handle sits on the TOC's left edge (the content/TOC seam). Hovering reveals a thin bar so the zone is discoverable.
    • Dragging sets a session-only contentWidthOverride from the seam column. It lifts the configured cap, so content grows past 100 cols and the TOC rides along.
  • Double-click reset
    • A double-click on the seam clears the override back to the cap. The handle, glued to the content edge, returns with it.

Invisible 1-col grab zone on the sidebar's left edge. Drag sets a
session-only width override (view.tocWidthOverride); double-click resets
to auto width. A full-screen drag shield owns the drag stream so capture
survives the pointer leaving the 1-col handle on the first motion.

Width override lives in the view-state store; clamp helpers are pure in
sidebar-resize.ts.
Drag the seam to set a session-only content max-width override, lifting
the configured cap so wide terminals reclaim the dead space as readable
content in both drag directions. The TOC stays auto-width and rides the
seam. Double-click clears the override.

App owns the gesture (onSeamDown) so double-click reset works whether the
second press lands on the handle or the drag shield; a drag clears the
double-click timer so a drag's mousedown never pairs with the next click.
@github-actions

Copy link
Copy Markdown

Startup benchmark (--render test/exhaustive.md, linux-x64)

build mean ratio verdict
baseline (main@416931a) 723.5ms ± 10.4ms
PR 719.7ms ± 13.6ms 0.99× ✅ ok

Thresholds: warn ≥ 1.1×, fail ≥ 1.25×. Baseline built from main.

@denolfe
denolfe marked this pull request as ready for review August 13, 2026 23:49
@denolfe
denolfe merged commit daae0b5 into main Aug 13, 2026
8 checks passed
@denolfe
denolfe deleted the feat/sidebar-drag-resize branch August 13, 2026 23:50
denolfe added a commit that referenced this pull request Aug 15, 2026
- feat(sidebar): widen content when the toc is hidden (#50) (6cce955)
- feat(sidebar): drag-resize content width with a mouse handle (#49) (daae0b5)
- feat: render dot and graphviz fences as ascii diagrams (#48) (416931a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant